<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="module">
    // then的特点:
    // 1- then是Promise原型对象下的一个函数
    // 2- then接收两个参数,类型均是函数(成功回调(onResolved),失败回调(onRejected))
    // 2-1- 状态为成功,执行成功回调
    // 2-2- 状态为失败,执行失败回调
    // import Promise from "./index.js";
    const p = new Promise(function(resolve,reject){
		// resolve(100);
		reject(200);
		throw "异常";
    });
	p.then(function(value){
		console.log("成功回调",value)
    },function(reason){
		console.log("失败回调",reason)
    })

</script>
</html>